import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:osg/controllers/http.dart';



class RankingRule extends StatefulWidget {

  RankingRule({super.key});

  @override
  State<RankingRule> createState() => _SettingPageState();
}

class _SettingPageState extends State<RankingRule> {
  RxString info = ''.obs;

getInfo(){
  Get.find<HTTPS>()
        .getData('/setting/hof_agreement', {}).then((res) {
      if (res != null) {
        info.value = res['setting']['modules'][0]['html'];
      }
    });
}


  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((_) {
      getInfo();
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
           appBar: AppBar(
            backgroundColor: Color(0xffffffff),
            title: Text('名人堂规则'),
            centerTitle: true
          ),
          body:
          Obx(()=>
          Html(
              data: info.value,
              style: {
                
                "p": Style(
                  margin: Margins.only(top: 0,bottom: 0),
                  padding: HtmlPaddings.only(top: 0,bottom: 0),
                  lineHeight: LineHeight(1.0), // 调整行高
                ),
                "br": Style(
                  margin: Margins.only(top: 0,bottom: 0),
                  padding: HtmlPaddings.only(top: 0,bottom: 0),
                  height: Height(1), // 调整换行高度
                ),
              },
            )
           
          )
    );
  }
}
